package com.easyctrl.dialog;

import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;

import com.easyctrl.ldy.activity.R;
import com.easyctrl.ui.base.BaseDialog;

public class DeleteTimerDialog extends BaseDialog implements OnClickListener {

	public interface OnClickListener {
		public void onCancel();
		public void onEnter();
	}
	
	private OnClickListener onClickListener; 
	
	public void setOnClickListener(OnClickListener onClickListener) {
		this.onClickListener = onClickListener;
	}

	public DeleteTimerDialog(Context context,OnClickListener onClickListener) {
		super(context);

		this.onClickListener = onClickListener;
		
		setContentView(R.layout.dialog_delete_time);

		findViewById(R.id.cancel).setOnClickListener(this);
		findViewById(R.id.enter).setOnClickListener(this);

	} 
	
	@Override
	public void onClick(View v) {
		if (v.getId() == R.id.cancel) {
			onClickListener.onCancel();
			this.dismiss();
		} else if (v.getId() == R.id.enter) {
			onClickListener.onEnter();
			this.dismiss();
		}
	}
}
